import type {ICommonResponse} from "@/types/global";
import request from "@/utils/request";

export interface IThirdLevelCategoryVOS {
    categoryId: number
    categoryLevel: number
    categoryName: string
}

export interface ISecondLevelCategoryVOS {
    categoryId: number
    categoryLevel: number
    categoryName: string
    parentId: number
    thirdLevelCategoryVOS: IThirdLevelCategoryVOS[]
}

export interface ICategoryItem {
    categoryId: number
    categoryLevel: number
    categoryName: string
    secondLevelCategoryVOS: ISecondLevelCategoryVOS[]
}

const getCategoryListAPI = (): ICommonResponse<ICategoryItem[]> => {
    return request({
        url: '/api/v1/categories',
        method: "GET",
    })
}
export default getCategoryListAPI